<?php
$db=new PDO('mysql:host=localhost;dbname=db','root','12qwas');
$r=$db->query("select * from chengyu limit 2");
foreach ($r  as $row) {
    print_r($row);
}